package com.black.protocol;

public enum ErrorCode
{
    SUCCESS_OK(0, "success"),
    ERROR_UNKNOWN(-1, "internal error"),
    ERROR_PARAM_MISSING(1001, "param is missing"),
    ERROR_PARAM_ILLEGAL(1002, "param is illegal"),
    ERROR_TOKEN_INVALID(1003, "token is invalid"),
    ERROR_CLASS_NOT_FOUND(2001, "class not found"),
    ERROR_CLASS_CAST_FAILED(2002, "class cast failed"),
    ERROR_CODE_TIME_OUT(6001, "verify code time out"),
    ERROR_CODE_WRONG(6002, "verify code wrong"),
    ERROR_USER_ALREADY_EXIST(6003, "username already exist"),
    ERROR_USER_OR_PASS(6004, "username or password error"),
    ERROR_EMAIL_NOT_EXIST(6005, "email not exist"),
    ERROR_USER_LOCK(6006, "username is lock"),
    ERROR_FILE_NOT_EXIST(8001, "file not exist"),
    ERROR_FILE_SAVE_FAILED(8002, "file save failed"),
    ERROR_SERVICE_UN_ACCESS(9001, "service can't access,please wait");

    final int code;
    final String msg;

    ErrorCode(int code, String msg)
    {
        this.code = code;
        this.msg = msg;
    }

    public int getCode()
    {
        return code;
    }

    public String getMsg()
    {
        return msg;
    }
}
